Introduction
Get an overview of the contents and understand the structure of this section.
We'll cover the following
Managing compute infrastructure, even in the era of the cloud, is still a challenge. With the innovations in containerization, virtual machines (VMs), and serverless computing, developers might believe that compute infrastructure is a solved problem.
Nothing could be farther from the truth. For cloud providers or others running their own data centers, bare metal machines (the machine's OS not running in virtualization) must be managed. This has become more complicated in the era of cloud computing. Not only does our provider need to manage their OS rollouts and patches, but so do cloud customers who want to run fleets of VMs and containers. Container orchestration systems such as Kubernetes must still provide container images that contain an OS image.
In the cloud, just like a physical data center, it is important to force OS compliance for all containers and VMs. Allowing anyone to run whatever OS they want is the gateway to a security breach. To provide a secure platform for developers, we must provide a minimal OS standardized across all deployments.
Standardization of an OS across a fleet comes with nothing but upsides and very few downsides. Standardizing on an OS image is easiest when our company is small. Large companies, including cloud providers that have not done this in the early days, have suffered through massive projects to standardize OS images at later stages.
In this lesson, we will talk about how we can use Packer, a software package written in Go by HashiCorp, to manage the creation and patching of VM and container images. HashiCorp is the leader in the trend of Infrastructure as Code (IaC) that is moving through the industry.
Packer lets us use YAML and Go to provide a consistent way to build images across a multitude of platforms. Be it in VM images, Docker images, or bare metal images; Packer can create consistent environments for our workloads to run on.
As we write Packer configuration files and use the Packer binary, we will begin to see how Packer was written. Many of the interactions Packer defines were written using libraries such as os/exec that we talked about earlier.
Technical requirements#
The prerequisites for this section are as follows:
An AWS account.
An AWS Linux VM running on the AMD64 platform.
An AWS user account with administrator access and access to its secret.
Installation of Packer on the AWS Linux VM.
Installation of Goss on the AWS Linux VM.
To do the exercises in this section requires an AWS account. This will use compute time and storage on AWS, which will cost money, though you may be able to use an AWS Free Tier account.
Structure#
We will cover the following topics in this section:
Summary
Initializing Packer